// import Vue from 'vue'
// import Vuex from 'vuex'
// Vue.use(Vuex)
const state = {
	statusBarHeight: 39,
	/* 状态栏高度 */
	navBarHeight: 48,
	/* 导航栏高度 */
	windowWidth: 255,
	windowHeight:1000,
	userimg: '',
	uname: ''
}

const getters = {
	statusBarHeight(state) {
		return state.statusBarHeight
	},
	navBarHeight(state) {
		return state.navBarHeight
	},
	windowWidth(state) {
		return state.windowWidth
	},
	windowHeight(state) {
		return state.windowHeight
	},
	userimg(state) {
		return state.userimg
	},
	uname(state) {
		return state.uname
	}
}
const mutations = {
	tabarDara(state, value) {
		state.statusBarHeight = value.statusBarHeight
		state.navBarHeight = value.navBarHeight
		state.windowWidth = value.windowWidth
	},
	setuser(state, data) {
		state.userimg = data.avatarUrl
		state.uname = data.uname
	}
}

const actions = {
	doctaddasync(context, data) {
		context.commit('tabarDara', data)
	},
	cheangUser(context, data) {
		context.commit('setuser', data)
	}
}

export default {
	state,
	mutations,
	actions,
	getters
}

// export default store
